package com.ruoyi.teaching.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teaching.mapper.TeachingRecordMapper;
import com.ruoyi.teaching.domain.TeachingRecord;
import com.ruoyi.teaching.service.ITeachingRecordService;

/**
 * 学历信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-03-21
 */
@Service
public class TeachingRecordServiceImpl implements ITeachingRecordService 
{
    @Autowired
    private TeachingRecordMapper teachingRecordMapper;

    /**
     * 查询学历信息
     * 
     * @param recordId 学历信息主键
     * @return 学历信息
     */
    @Override
    public TeachingRecord selectTeachingRecordByRecordId(Long recordId)
    {
        return teachingRecordMapper.selectTeachingRecordByRecordId(recordId);
    }

    /**
     * 查询学历信息列表
     * 
     * @param teachingRecord 学历信息
     * @return 学历信息
     */
    @Override
    public List<TeachingRecord> selectTeachingRecordList(TeachingRecord teachingRecord)
    {
        return teachingRecordMapper.selectTeachingRecordList(teachingRecord);
    }

    /**
     * 新增学历信息
     * 
     * @param teachingRecord 学历信息
     * @return 结果
     */
    @Override
    public int insertTeachingRecord(TeachingRecord teachingRecord)
    {
        teachingRecord.setCreateTime(DateUtils.getNowDate());
        return teachingRecordMapper.insertTeachingRecord(teachingRecord);
    }

    /**
     * 修改学历信息
     * 
     * @param teachingRecord 学历信息
     * @return 结果
     */
    @Override
    public int updateTeachingRecord(TeachingRecord teachingRecord)
    {
        teachingRecord.setUpdateTime(DateUtils.getNowDate());
        return teachingRecordMapper.updateTeachingRecord(teachingRecord);
    }

    /**
     * 批量删除学历信息
     * 
     * @param recordIds 需要删除的学历信息主键
     * @return 结果
     */
    @Override
    public int deleteTeachingRecordByRecordIds(Long[] recordIds)
    {
        return teachingRecordMapper.deleteTeachingRecordByRecordIds(recordIds);
    }

    /**
     * 删除学历信息信息
     * 
     * @param recordId 学历信息主键
     * @return 结果
     */
    @Override
    public int deleteTeachingRecordByRecordId(Long recordId)
    {
        return teachingRecordMapper.deleteTeachingRecordByRecordId(recordId);
    }
}
